Skip to content

fix(auth): suppress browser output during login #25#98

Open
huda-code wants to merge 3 commits into
fosrl:mainfrom
huda-code:fix/suppress-browser-stderr
Open

fix(auth): suppress browser output during login #25#98
huda-code wants to merge 3 commits into
fosrl:mainfrom
huda-code:fix/suppress-browser-stderr

Conversation

@huda-code

@huda-code huda-code commented Jun 25, 2026

Copy link
Copy Markdown

Fixes #25.

This PR suppresses stdout/stderr from the browser launcher during the authentication login browser-open step.

The reported issue shows Chromium/Wayland-specific warnings being printed to the terminal even though the login succeeds. Since pkg/browser forwards the launched browser process's stdout and stderr to the CLI, this change temporarily redirects those streams to io.Discard while opening the browser, preventing browser-specific output from appearing during the login flow.

How to test

  • Built successfully using go build -o cli .
  • Ran go test ./...
  • Verified the browser still opens normally during the login flow.
  • Verified xdg-open launches the default browser successfully.
  • Tested in a Wayland environment (WAYLAND_DISPLAY=wayland-0).

I wasn't able to reproduce the original Chromium/Wayland warnings because my Linux environment uses Firefox as the default browser. This implementation is based on the observation that pkg/browser forwards the browser launcher's stdout/stderr to the CLI. If this doesn't resolve the issue in the original Chromium-based environment, I'm happy to investigate an alternative approach.

@huda-code

Copy link
Copy Markdown
Author

I wasn't able to reproduce the original Chromium/Wayland warnings because my Linux environment uses Firefox as the default browser. This implementation is based on the observation that pkg/browser forwards the browser launcher's stdout/stderr to the CLI, which appeared to be the most likely source of the reported output.

If this doesn't address the issue in the original environment, I'm happy to revise the implementation or investigate an alternative approach.

Comment thread cmd/auth/login/login.go Outdated
Removed suppression of browser output when opening the browser.

@huda-code huda-code left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks! You're right, the suppression was happening twice. I've removed the duplicated inline stdout/stderr logic in the goroutine and now call openBrowserQuietly(loginURL) directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2x error with CLI on Wayland (process of logging in is OK)

2 participants